<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
<title>DynamoRIO API: dr_frontend.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">DynamoRIO API
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dr__frontend_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">dr_frontend.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Tool front-end API. Use these functions to search for and query the properties of a target application file, check environment variables, and perform other common actions in a tool front-end executable. The library provides cross-platform utilities that support internationalization.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;tchar.h&gt;</code><br/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:afa7a8b9af2e39d441b3a31b3d5e19b05"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> { <br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05a9bb3826f6e2ec6b095a170e75e6d8164">DRFRONT_SUCCESS</a>, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05acfca3a3a3c77bcf72fe09836407932f8">DRFRONT_ERROR</a>, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05a44b3eed4870037b01678c6b48f2b909e">DRFRONT_ERROR_INVALID_PARAMETER</a>, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05aa9daaf3dbc1165e11a05dd93955ddd0f">DRFRONT_ERROR_INVALID_SIZE</a>, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05a242d49647e5d853bd4abf21e555771de">DRFRONT_ERROR_FILE_EXISTS</a>, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05a66e732c8c6d0a6d4546c80aaa7cb3ae5">DRFRONT_ERROR_INVALID_PATH</a>, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05a9de46d61b4f074497f04b0eb68cf818e">DRFRONT_ERROR_ACCESS_DENIED</a>, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05ac32f14d3bae699c87b48ecd0a04e0d65">DRFRONT_ERROR_LIB_UNSUPPORTED</a>
<br/>
 }</td></tr>
<tr class="memitem:acfd4ecf3103b976d1a1ac0f31c220f9a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9a">drfront_access_mode_t</a> { <br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9aa70d63063f9b27ad1ae1d2aeb0ac22bc8">DRFRONT_EXIST</a> =  0x00, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9aacfd7acb695a756fce28f091df0b6e0b1">DRFRONT_EXEC</a> =  0x01, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9aaddeb7afef36e79e01aae30295ec4634d">DRFRONT_WRITE</a> =  0x02, 
<br/>
&#160;&#160;<a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9aa737dc5f3619a1e65d7a9f4d660a0b44b">DRFRONT_READ</a> =  0x04
<br/>
 }</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa6389ada3f998b6793aa9a1edd290f97"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#aa6389ada3f998b6793aa9a1edd290f97">drfront_access</a> (const char *fname, <a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9a">drfront_access_mode_t</a> mode, OUT bool *ret)</td></tr>
<tr class="memitem:a81da80d0a57b172d2152dfb5f31fe904"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a81da80d0a57b172d2152dfb5f31fe904">drfront_searchenv</a> (const char *fname, const char *env_var, OUT char *full_path, const size_t full_path_size, OUT bool *ret)</td></tr>
<tr class="memitem:a62175001b9788c5b2a3ddd90c30aea46"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a62175001b9788c5b2a3ddd90c30aea46">drfront_bufprint</a> (INOUT char *buf, size_t bufsz, INOUT size_t *sofar, OUT ssize_t *len, char *fmt,...)</td></tr>
<tr class="memitem:a294c7a14808c036a3de17e2a6df650f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a294c7a14808c036a3de17e2a6df650f8">drfront_tchar_to_char</a> (const TCHAR *wstr, OUT char *buf, size_t buflen)</td></tr>
<tr class="memitem:ab1149f586b5fc500f39b5e06472f6b3d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#ab1149f586b5fc500f39b5e06472f6b3d">drfront_tchar_to_char_size_needed</a> (const TCHAR *wstr, OUT size_t *needed)</td></tr>
<tr class="memitem:a79b83207b4a11d11a0243002c5ceadba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a79b83207b4a11d11a0243002c5ceadba">drfront_char_to_tchar</a> (const char *str, OUT TCHAR *wbuf, size_t wbuflen)</td></tr>
<tr class="memitem:a6228f653be39a0a27f5ff3556e17dd1e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a6228f653be39a0a27f5ff3556e17dd1e">drfront_get_env_var</a> (const char *name, OUT char *buf, size_t buflen)</td></tr>
<tr class="memitem:ac542fe083bd9f9fa52f3c1224df00453"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#ac542fe083bd9f9fa52f3c1224df00453">drfront_get_absolute_path</a> (const char *src, OUT char *buf, size_t buflen)</td></tr>
<tr class="memitem:abd97a62c782126b1fadf42d013746240"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#abd97a62c782126b1fadf42d013746240">drfront_get_app_full_path</a> (const char *app, OUT char *buf, size_t buflen)</td></tr>
<tr class="memitem:a69202de2e91ee71e526e1ccecfe76c42"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a69202de2e91ee71e526e1ccecfe76c42">drfront_is_64bit_app</a> (const char *exe, OUT bool *is_64)</td></tr>
<tr class="memitem:ac86ceb61e1362177b8545a0e38bcb440"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#ac86ceb61e1362177b8545a0e38bcb440">drfront_is_graphical_app</a> (const char *exe, OUT bool *is_graphical)</td></tr>
<tr class="memitem:acf4ef74b6af29bab7998b53af7dd7fcf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#acf4ef74b6af29bab7998b53af7dd7fcf">drfront_convert_args</a> (const TCHAR **targv, OUT char ***argv, int argc)</td></tr>
<tr class="memitem:a4bf227c8498dcc60ac212d9373b79065"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a4bf227c8498dcc60ac212d9373b79065">drfront_cleanup_args</a> (char **argv, int argc)</td></tr>
<tr class="memitem:a24657cdddf3c41ab4d86f0a825da99d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a24657cdddf3c41ab4d86f0a825da99d9">drfront_appdata_logdir</a> (const char *root, const char *subdir, OUT bool *use_root, OUT char *buf, size_t buflen)</td></tr>
<tr class="memitem:a0cd3e13df4adec94c59658e4d7a20dbb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a0cd3e13df4adec94c59658e4d7a20dbb">drfront_string_replace_character</a> (OUT char *str, char old_char, char new_char)</td></tr>
<tr class="memitem:a5e20c778ad12137125a1b82f317b3c31"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a5e20c778ad12137125a1b82f317b3c31">drfront_string_replace_character_wide</a> (OUT TCHAR *str, TCHAR old_char, TCHAR new_char)</td></tr>
<tr class="memitem:a4d2ab2e2fa14bb993c543b28c3fc6c83"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a4d2ab2e2fa14bb993c543b28c3fc6c83">drfront_set_client_symbol_search_path</a> (const char *symdir, bool ignore_env, OUT char *symsrv_path, size_t symsrv_path_sz)</td></tr>
<tr class="memitem:af87174096643bd6574d0b23d79e99afb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#af87174096643bd6574d0b23d79e99afb">drfront_set_symbol_search_path</a> (const char *symsrv_path)</td></tr>
<tr class="memitem:a5f07d84ba1c34d33a62d978ab88391cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a5f07d84ba1c34d33a62d978ab88391cd">drfront_sym_init</a> (const char *wsymsrv_path, const char *dbghelp_path)</td></tr>
<tr class="memitem:a13a6b316092095426bc5bf42fa3be5cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a13a6b316092095426bc5bf42fa3be5cd">drfront_sym_exit</a> (void)</td></tr>
<tr class="memitem:a1c6416928a53bb61d409747db0614a69"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a1c6416928a53bb61d409747db0614a69">drfront_fetch_module_symbols</a> (const char *modpath, OUT char *symbol_path, size_t symbol_path_sz)</td></tr>
<tr class="memitem:a76fca16cd5d3d9599a268da7bdafd590"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a76fca16cd5d3d9599a268da7bdafd590">drfront_create_dir</a> (const char *dir)</td></tr>
<tr class="memitem:a5cc2c367395be6c3841bd5ab9023303c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a5cc2c367395be6c3841bd5ab9023303c">drfront_remove_dir</a> (const char *dir)</td></tr>
<tr class="memitem:a194e3bdb90ae408da46f4f87469bfe00"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dr__frontend_8h.html#a194e3bdb90ae408da46f4f87469bfe00">drfront_dir_exists</a> (const char *path, bool *is_dir)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Tool front-end API. Use these functions to search for and query the properties of a target application file, check environment variables, and perform other common actions in a tool front-end executable. The library provides cross-platform utilities that support internationalization. </p>
<p>The general usage model is for the front-end executable to always deal with UTF-8 strings and let this front-end library perform conversion back and forth to UTF-16 when interacting with Windows library. The executable should declare its main routine as follows:</p>
<p>int _tmain(int argc, TCHAR *targv[])</p>
<p>And then invoke <a class="el" href="dr__frontend_8h.html#acf4ef74b6af29bab7998b53af7dd7fcf">drfront_convert_args()</a> to convert them to UTF-8. All further references to the arguments should use the UTF-8 versions. On Linux or MacOS, _tmain and TCHAR will turn into regular symbols. </p>
</div><hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="acfd4ecf3103b976d1a1ac0f31c220f9a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9a">drfront_access_mode_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Permission modes for <a class="el" href="dr__frontend_8h.html#aa6389ada3f998b6793aa9a1edd290f97">drfront_access()</a> </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="acfd4ecf3103b976d1a1ac0f31c220f9aa70d63063f9b27ad1ae1d2aeb0ac22bc8"></a>DRFRONT_EXIST</em>&nbsp;</td><td>
<p>Test existence </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="acfd4ecf3103b976d1a1ac0f31c220f9aacfd7acb695a756fce28f091df0b6e0b1"></a>DRFRONT_EXEC</em>&nbsp;</td><td>
<p>Test for execute access </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="acfd4ecf3103b976d1a1ac0f31c220f9aaddeb7afef36e79e01aae30295ec4634d"></a>DRFRONT_WRITE</em>&nbsp;</td><td>
<p>Test for write access </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="acfd4ecf3103b976d1a1ac0f31c220f9aa737dc5f3619a1e65d7a9f4d660a0b44b"></a>DRFRONT_READ</em>&nbsp;</td><td>
<p>Test for read access </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Status code for each DRFront operation </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05a9bb3826f6e2ec6b095a170e75e6d8164"></a>DRFRONT_SUCCESS</em>&nbsp;</td><td>
<p>Operation succeeded </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05acfca3a3a3c77bcf72fe09836407932f8"></a>DRFRONT_ERROR</em>&nbsp;</td><td>
<p>Operation failed </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05a44b3eed4870037b01678c6b48f2b909e"></a>DRFRONT_ERROR_INVALID_PARAMETER</em>&nbsp;</td><td>
<p>Operation failed: invalid parameter </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05aa9daaf3dbc1165e11a05dd93955ddd0f"></a>DRFRONT_ERROR_INVALID_SIZE</em>&nbsp;</td><td>
<p>Operation failed: invalid size </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05a242d49647e5d853bd4abf21e555771de"></a>DRFRONT_ERROR_FILE_EXISTS</em>&nbsp;</td><td>
<p>Operation failed: dir or file already exists </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05a66e732c8c6d0a6d4546c80aaa7cb3ae5"></a>DRFRONT_ERROR_INVALID_PATH</em>&nbsp;</td><td>
<p>Operation failed: wrong path </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05a9de46d61b4f074497f04b0eb68cf818e"></a>DRFRONT_ERROR_ACCESS_DENIED</em>&nbsp;</td><td>
<p>Operation failed: access denied </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7a8b9af2e39d441b3a31b3d5e19b05ac32f14d3bae699c87b48ecd0a04e0d65"></a>DRFRONT_ERROR_LIB_UNSUPPORTED</em>&nbsp;</td><td>
<p>Operation failed: old version or invalid library </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="aa6389ada3f998b6793aa9a1edd290f97"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_access </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>fname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="dr__frontend_8h.html#acfd4ecf3103b976d1a1ac0f31c220f9a">drfront_access_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT bool *&#160;</td>
          <td class="paramname"><em>ret</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Checks <code>fname</code> for the permssions specified by <code>mode</code>.</p>
<dl class="section note"><dt>Note:</dt><dd>DRFRONT_EXEC is ignored on Windows because _waccess doesn't test it.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">fname</td><td>The filename to test permission to. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>The permission to test the file for. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ret</td><td>True iff <code>fname</code> has the permission specified by <code>mode</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a24657cdddf3c41ab4d86f0a825da99d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_appdata_logdir </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>subdir</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT bool *&#160;</td>
          <td class="paramname"><em>use_root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If a tool is installed into a "Program Files" directory on Windows, or into "/usr/..." on Linux, it needs to store its log files elsewhere. This utility function helps to select that alternative location. First, it checks whether <code>root</code> is in a location where log files should not be created, and returns that result in <code>use_root</code>. If <code>use_root</code> is false, this function returns a suggested alternative directory for log files in <code>buf</code>. It looks in standard locations such as "$APPDATA" or "$USERPROFILE/Application Data" on Windows or in temp directories if those fail or if on Linux. It appends <code>subdir</code> to the base application data or temp directory. It is up to the caller to create the returned directory if it does not exist.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>The location where the tool's binaries are installed. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">subdir</td><td>A directory to append to the application data directory to form a result in <code>buf</code>. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">use_root</td><td>Returns whether <code>root</code> is suitable for storing log files. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>If <code>use_root</code> is false, this buffer is filled with a suggested directory for storing log files. The directory ends with <code>subdir</code>. If <code>use_root</code> is true, <code>buf's</code> contents are undefined. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buflen</td><td>The maximum capacity of <code>buf</code>, in elements. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a62175001b9788c5b2a3ddd90c30aea46"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_bufprint </td>
          <td>(</td>
          <td class="paramtype">INOUT char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bufsz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">INOUT size_t *&#160;</td>
          <td class="paramname"><em>sofar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT ssize_t *&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>fmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Concatenate onto a buffer. The buffer is not resized if the content does not fit.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">buf</td><td>The buffer to concatenate onto. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">bufsz</td><td>The allocated size of <code>buf</code>. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">sofar</td><td>The number of bytes added so far. Cumulative between calls. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">len</td><td>The number of bytes sucessfully written to <code>buf</code> this call. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">fmt</td><td>The format string to be added to <code>buf</code>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">...</td><td>Any data needed for the format string. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a79b83207b4a11d11a0243002c5ceadba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_char_to_tchar </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT TCHAR *&#160;</td>
          <td class="paramname"><em>wbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>wbuflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Converts from UTF-8 to UTF-16.</p>
<dl class="section note"><dt>Note:</dt><dd>On UNIX the information is simply copied from <code>str</code> to <code>wbuf</code>.</dd>
<dd>
Always null-terminates.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>The UTF-8 string to be converted to UTF-16. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">wbuf</td><td>The destination of the new UTF-16 string. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">wbuflen</td><td>The allocated size of <code>wbuf</code> in elements. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4bf227c8498dcc60ac212d9373b79065"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_cleanup_args </td>
          <td>(</td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>argv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Frees the UTF-8 array of command-line arguments.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">argv</td><td>The array of command-line arguments. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">argc</td><td>The number of command-line arguments. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="acf4ef74b6af29bab7998b53af7dd7fcf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_convert_args </td>
          <td>(</td>
          <td class="paramtype">const TCHAR **&#160;</td>
          <td class="paramname"><em>targv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char ***&#160;</td>
          <td class="paramname"><em>argv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Converts the command-line arguments to UTF-8.</p>
<dl class="section note"><dt>Note:</dt><dd>This function allocates memory on the heap that must be freed by calling <a class="el" href="dr__frontend_8h.html#a4bf227c8498dcc60ac212d9373b79065">drfront_cleanup_args()</a>.</dd>
<dd>
On UNIX the data is simply copied.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">targv</td><td>The original command-line arguments. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">argv</td><td>The original command-line arguments in UTF-8. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">argc</td><td>The number of command-line arguments. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a76fca16cd5d3d9599a268da7bdafd590"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_create_dir </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dir</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine creates the directory specified in <code>dir</code>.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">dir</td><td>New directory name. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a194e3bdb90ae408da46f4f87469bfe00"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_dir_exists </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>is_dir</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine checks whether <code>path</code> is a valid directory.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>The path to be checked </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">is_dir</td><td>Returns whether <code>path</code> is a valid directory. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1c6416928a53bb61d409747db0614a69"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_fetch_module_symbols </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>modpath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>symbol_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>symbol_path_sz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine tries to fetch all missed symbols for module specified in <code>modpath</code> using _NT_SYMBOL_PATH environment var. User should call <code>drfront_sym_init</code>, drfront_sym_set_search_path() and drfront_sym_set_search_path() before calling this routine. If success function returns full path to fetched symbol file in <code>symbol_path</code>.</p>
<dl class="section note"><dt>Note:</dt><dd>The routine will fetch symbols from remote MS Symbol Server only if symbols don't exist in the search paths and _NT_SYMBOL_PATH has right srv* path &amp; link. The routine requires DbgHelp.dll 6.0 or later.</dd></dl>
<dl class="section warning"><dt>Warning:</dt><dd>The routine will fail when using the system copy of dbghelp.dll on Windows XP or 2003. The client should use its own copy of dbghelp.dll version 6.0 or later.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">modpath</td><td>The name of the image to be loaded. This name can contain a partial path, a full path, or no path at all. If the file cannot be located by the name provided, the routine returns DRFRONT_OBJ_NOEXIST. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">symbol_path</td><td>The full path to fetched symbols file. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">symbol_path_sz</td><td>Size of <code>symbol_path</code> argument in characters. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac542fe083bd9f9fa52f3c1224df00453"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_get_absolute_path </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Gets the absolute path of <code>src</code>.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>The path to expand. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>The buffer to place the absolute path in. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buflen</td><td>The allocated size of <code>buf</code> in elements. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="abd97a62c782126b1fadf42d013746240"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_get_app_full_path </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>app</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Gets the full path of <code>app</code>, which is located by searching the PATH if necessary.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">app</td><td>The executable to get the full path of. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>The buffer to place the full path in if found. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buflen</td><td>The allocated size of <code>buf</code> in elements. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6228f653be39a0a27f5ff3556e17dd1e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_get_env_var </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Stores the contents of the environment variable <code>name</code> in <code>buf</code>.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name of the environment variable. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>The destination to store the contents of <code>name</code>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buflen</td><td>The allocated size of <code>buf</code> in elements. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a69202de2e91ee71e526e1ccecfe76c42"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_is_64bit_app </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>exe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT bool *&#160;</td>
          <td class="paramname"><em>is_64</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads the file header to determine if <code>exe</code> is a 64-bit application.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">exe</td><td>The executable to check for the 64-bit flag. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">is_64</td><td>True if <code>exe</code> is a 64-bit application. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac86ceb61e1362177b8545a0e38bcb440"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_is_graphical_app </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>exe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT bool *&#160;</td>
          <td class="paramname"><em>is_graphical</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads the PE header to determine if <code>exe</code> has a GUI.</p>
<dl class="section note"><dt>Note:</dt><dd>This function always returns false on UNIX because it is not relevant.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">exe</td><td>The executable to check the subsystem of. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">is_graphical</td><td>True if <code>exe's</code> subsystem is graphical. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5cc2c367395be6c3841bd5ab9023303c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_remove_dir </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dir</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine removes the empty directory specified in <code>dir</code>.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">dir</td><td>Name of directory to remove. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a81da80d0a57b172d2152dfb5f31fe904"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_searchenv </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>fname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>env_var</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>full_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>full_path_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT bool *&#160;</td>
          <td class="paramname"><em>ret</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Implements a normal path search for <code>fname</code> on the paths in <code>env_var</code>. Resolves symlinks.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">fname</td><td>The filename to search for. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">env_var</td><td>The environment variable that contains the paths to search for <code>fname</code>. Paths are ;-separated on Windows and :-separated on UNIX. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">full_path</td><td>The full path of <code>fname</code> if it is found. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">full_path_size</td><td>The maximum size of <code>full_path</code>. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ret</td><td>True iff <code>fname</code> is found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4d2ab2e2fa14bb993c543b28c3fc6c83"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_set_client_symbol_search_path </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>symdir</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>ignore_env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>symsrv_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>symsrv_path_sz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the environment variable _NT_SYMBOL_PATH and the dbghelp search path for symbol lookup in a client, without any network symbol server component (such components are unsafe in a client).</p>
<p>If the _NT_SYMBOL_PATH is already specified, this routine validates it and if invalid replaces it.</p>
<p>This routine also takes the client symbol lookup path and adds the Microsoft symbol server for use in a frontend itself (not in a client) and returns that path in <code>symsrv_path</code>. The frontend can enable use of this path by calling <a class="el" href="dr__frontend_8h.html#af87174096643bd6574d0b23d79e99afb">drfront_set_symbol_search_path()</a>.</p>
<p><a class="el" href="dr__frontend_8h.html#a5f07d84ba1c34d33a62d978ab88391cd">drfront_sym_init()</a> must be called before calling this routine.</p>
<dl class="section note"><dt>Note:</dt><dd>This routine requires DbgHelp.dll 6.0 or later.</dd></dl>
<dl class="section warning"><dt>Warning:</dt><dd>This routine will fail when using the system copy of dbghelp.dll on Windows XP or 2003. The client should use its own copy of dbghelp.dll version 6.0 or later.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">symdir</td><td>A local symbol cache directory. It can be passed without srv* prepended. It will have "/symbols" appended to it. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">ignore_env</td><td>If TRUE, any existing _NT_SYMBOL_PATH value is ignored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">symsrv_path</td><td>Returns a symbol path that includes the Microsoft symbol server. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">symsrv_path_sz</td><td>The maximum length, in characters, of <code>symsrv_path</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af87174096643bd6574d0b23d79e99afb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_set_symbol_search_path </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>symsrv_path</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the symbol search path for this frontend process to the specified value. Typically this would be used with the output value from <a class="el" href="dr__frontend_8h.html#a4d2ab2e2fa14bb993c543b28c3fc6c83">drfront_set_client_symbol_search_path()</a>.</p>
<p><a class="el" href="dr__frontend_8h.html#a5f07d84ba1c34d33a62d978ab88391cd">drfront_sym_init()</a> must be called before calling this routine.</p>
<dl class="section note"><dt>Note:</dt><dd>The routine requires DbgHelp.dll 6.0 or later.</dd></dl>
<dl class="section warning"><dt>Warning:</dt><dd>The routine will fail when using the system copy of dbghelp.dll on Windows XP or 2003. The client should use its own copy of dbghelp.dll version 6.0 or later.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">symsrv_path</td><td>The symbol search path to use. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0cd3e13df4adec94c59658e4d7a20dbb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void drfront_string_replace_character </td>
          <td>(</td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>old_char</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>new_char</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Replace occurences of <code>old_char</code> with <code>new_char</code> in <code>str</code>. Typically used to canonicalize Windows paths into using forward slashes.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>The string whose characters should be replaced. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">old_char</td><td>Old character to be replaced. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">new_char</td><td>New character to use. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5e20c778ad12137125a1b82f317b3c31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void drfront_string_replace_character_wide </td>
          <td>(</td>
          <td class="paramtype">OUT TCHAR *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TCHAR&#160;</td>
          <td class="paramname"><em>old_char</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TCHAR&#160;</td>
          <td class="paramname"><em>new_char</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Replace occurences of <code>old_char</code> with <code>new_char</code> in TCHAR <code>str</code>. Typically used to canonicalize Windows paths into using forward slashes.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>A string whose characters should be replaced. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">old_char</td><td>Old character to be replaced. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">new_char</td><td>New character to use. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a13a6b316092095426bc5bf42fa3be5cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_sym_exit </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine deallocates all symbol-related resources associated with the current process. </p>

</div>
</div>
<a class="anchor" id="a5f07d84ba1c34d33a62d978ab88391cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_sym_init </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>wsymsrv_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dbghelp_path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This routine initializes the symbol handler for the current process. Should be called before <a class="el" href="dr__frontend_8h.html#af87174096643bd6574d0b23d79e99afb">drfront_set_symbol_search_path()</a> and <a class="el" href="dr__frontend_8h.html#a1c6416928a53bb61d409747db0614a69">drfront_fetch_module_symbols()</a>.</p>
<dl class="section note"><dt>Note:</dt><dd>The routine requires DbgHelp.dll 6.0 or later.</dd></dl>
<dl class="section warning"><dt>Warning:</dt><dd>The routine will fail when using the system copy of dbghelp.dll on Windows XP or 2003. The client should use its own copy of dbghelp.dll version 6.0 or later.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">wsymsrv_path</td><td>The path, or series of paths separated by a semicolon (;), that is used to search for symbol files. If this parameter is NULL, the library attempts to form a symbol path from the following sources: the current working directory, _NT_SYMBOL_PATH, _NT_ALTERNATE_SYMBOL_PATH. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dbghelp_path</td><td>The path to dbghelp.dll. If the string specifies a full path, the routine looks only in that path for the module. If the string specifies a relative path or a module name without a path, the function uses a standard Windows library search strategy to find the module. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a294c7a14808c036a3de17e2a6df650f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_tchar_to_char </td>
          <td>(</td>
          <td class="paramtype">const TCHAR *&#160;</td>
          <td class="paramname"><em>wstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buflen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Converts from UTF-16 to UTF-8.</p>
<dl class="section note"><dt>Note:</dt><dd>On UNIX the information is simply copied from <code>wstr</code> to <code>buf</code>.</dd>
<dd>
Always null-terminates.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">wstr</td><td>The UTF-16 string to be converted to UTF-8. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>The destination of the new UTF-8 string. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buflen</td><td>The allocated size of <code>buf</code> in elements. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab1149f586b5fc500f39b5e06472f6b3d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="dr__frontend_8h.html#afa7a8b9af2e39d441b3a31b3d5e19b05">drfront_status_t</a> drfront_tchar_to_char_size_needed </td>
          <td>(</td>
          <td class="paramtype">const TCHAR *&#160;</td>
          <td class="paramname"><em>wstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OUT size_t *&#160;</td>
          <td class="paramname"><em>needed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Gets the necessary size of a UTF-8 buffer to hold the content in <code>wstr</code>.</p>
<dl class="section note"><dt>Note:</dt><dd>needed includes the terminating null character.</dd></dl>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">wstr</td><td>The UTF-16 string to be converted later. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">needed</td><td>The size a buffer has to be to hold <code>wstr</code> in UTF-8. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_3f960cec7fb648840e8ab2c814e874ae.html">include</a></li><li class="navelem"><a class="el" href="dr__frontend_8h.html">dr_frontend.h</a></li>
    <li class="footer" style="float:none;text-align:center"><img border=0 src="favicon.png"> &nbsp;  DynamoRIO API version 5.0.0 --- Wed Sep 10 2014 21:36:43 &nbsp; <img border=0 src="favicon.png">
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>
